import os
import shutil

# 创建文件夹
def mkdir(name):
    try:
        os.mkdir(name)
    except OSError as e:
        raise Exception(f"failed to create directory: {e}")

# 删除文件或文件夹
def remove(name):
    try:
        if os.path.isdir(name):
            shutil.rmtree(name)
        else:
            os.remove(name)
    except OSError as e:
        raise Exception(f"failed to remove file or directory: {e}")

# 检查文件或文件夹是否存在
def exists(name):
    return os.path.exists(name)
